<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<div class="container" style="width:100%">
	<div class="container-fluid">
	<h4 class="modal-title">编号:${sign.jobNumber}&nbsp;&nbsp;&nbsp;姓名:${sign.name}</h4>
	<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
		<div class="table-responsive" style="overflow-x: hidden;width:100%">
			<form class="form-horizontal" role="form" id="edieForm" name="edieForm" action="">
			  <input type="hidden" id="signLogid" name="signLogid" value="${signLog.id}"/>
			  <div class="form-group">
			    <label for="firstname" class="col-sm-2 control-label">项目</label>
			    <div class="col-sm-8">
			     	<select  class="selectOption form-control" style="width:100%" id="projectCode">
			     		 <c:forEach var="VO" items="${proList}" varStatus="index">
			     		 	<c:if test="${signLog.projectCode eq VO.projectCode}">
			     		 		<option value="${VO.projectCode}" selected="selected">${VO.projectName}</option>
			     		 	</c:if>
			     		 	<c:if test="${signLog.projectCode ne VO.projectCode}">
			     		 		<option value="${VO.projectCode}">${VO.projectName}</option>
			     		 	</c:if>
					   	 </c:forEach>
			     	</select>
			    </div>
			  </div>
			  <div class="form-group">
			    <label for="lastname" class="col-sm-2 control-label">上班</label>
			    <div class="col-sm-8">
			      <input type="text" class="Wdate form-control" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" id="signToWorkStr" name ="signToWorkStr" value="${signLog.signToWorkStr}" style="height:25px;"/>
			    </div>
			  </div>
			  <div class="form-group">
			    <label for="lastname" class="col-sm-2 control-label">下班</label>
			    <div class="col-sm-8">
			      <input type="text" class="Wdate form-control" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" id="signOffWorkStr" name ="signOffWorkStr" value="${signLog.signOffWorkStr}" style="height:25px;"/>
			    </div>
			  </div>
			  <div class="form-group text-c text-right">
			    <div class="col-sm-offset-2 col-sm-8">
			      <button type="button" class="btn btn-success" id="updateBtn11">更新</button>
			      <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
			    </div>
			  </div>
			</form>
		</div>
	</div>
</div>
<script type="text/javascript">
function alertWinEdit(content){
	$.alert({
	    title: '提示框',
	    content: content,
	    confirm: function(){
	    }
	});
}
$(function(){
	$("#updateBtn11").click(function(){
		$.ajax({
			url:"updateSignLog",
			data:{id:$("#signLogid").val(),projectCode:$("#projectCode").val(),signToWorkStr:$("#signToWorkStr").val(),signOffWorkStr:$("#signOffWorkStr").val()},
			async:false,
			dataType:"json",
			type:"post",
			success:function(data){
				if(data.status=='success'){
					window.location.href='<%=basePath%>sign/signEdit?eId=${signLog.eId}';
				}else{
					alertWinEdit("更新失败");
				}
			}
		});
	});
	 $("#edieModal").on("hidden.bs.modal", function() {
	        $(this).removeData("bs.modal");
	 });

});
</script>
